<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2019/12/18
  Time: 10:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="show" method="post">
    <input type="hidden" name="count" value="${count}">
    <h3>${showinfo.title}</h3>
    <P>${showinfo.viewTimes}次查看,共有${count} 人投票</P>
    <c:forEach items="${options}" var="option"  varStatus="var">
        <table>
            <tr align="center">
                <td> ${var.index+1}</td>
                <td><input type="radio" name='radio' value="${option.id}" >${option.optContent}</td>
                <td>&nbsp;&nbsp;&nbsp;&nbsp;${option.vote}票 &nbsp;&nbsp;&nbsp;&nbsp;${option.vote/showinfo.totalVotes*100}%</td>
            </tr>

        </table>
    </c:forEach>
    <input type="submit" value="我要投票" onclick="javascript:location.href=''">    <a href="test">返回首页</a>
</form>

</body>
<script>
    var tempradio= null;
    function check(checkedRadio)
    {
        if(tempradio== checkedRadio){
            tempradio.checked=false;
            tempradio=null;
        }
        else{
            tempradio= checkedRadio;
        }
    }
</script>
</body>
</html>
